////////////////////////////////////////
//	File Header
//	Author: Stephen Ringer | stephen.ringer@gmail.com
//	File: SAGAQueue.h
//
////////////////////////////////////////
#pragma once

////////////////////////////////////////
//	Class Name:
//	Purpose:
//		This generic data type is managed by the SAGAQueue.
class SAGAQueueElem 
{
public:
	SAGAQueueElem(const char *pData, unsigned int nSize);
	~SAGAQueueElem();

	SAGAQueueElem *m_pNext;
	char         *m_pData;
	unsigned int  m_nSize;
};
//
////////////////////////////////////////

////////////////////////////////////////
//	Class Name: SAGAQueue
//	Purpose:
//		Plain straight simple FIFO queue.
class SAGAQueue 
{
private:
	SAGAQueueElem *m_pHead;
	SAGAQueueElem *m_pTail;
	unsigned int  m_Count;

public:
	SAGAQueue(void);
	~SAGAQueue(void);

	void Dequeue(void);
	void Enqueue(const void *pData, unsigned int nSize);
	void Front(void *pData, bool bDequeue);

	unsigned int GetCount(void) { return m_Count; }

	unsigned int GetFrontSize(void) 
	{ 
		if (m_pHead) return m_pHead->m_nSize; else return 0;
	}		
};
//
////////////////////////////////////////